import Vue from 'vue'
import Vuex from 'vuex'

// import goodsDetail from './modules/goods-detail.js'
import user from './modules/user.js'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    type1: "bake",
    searchRecipeList: [],
    CollectName: ''
  },
  getters: {
  },
  mutations: {
    chooseType(state, type) {
      state.type1 = type
    },
    // 搜索过滤的菜谱列表传到仓库searchRecipeList
    searchRecipe(state, recipe) {
      state.searchRecipeList = recipe;
      localStorage.setItem('searchRecipeList', JSON.stringify(recipe));

    },
    CollectName(state, value) {
      state.CollectName = value
    }
  },
  actions: {
  },
  modules: {
    user
  }
})
